<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
    <a class="navbar-brand" href="#">LOGS</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
            aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarsExampleDefault">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item{% if url == 'home' %} active {% endif %}">
                <a class="nav-link" href="{% url 'home' %}">首页{% if url == 'home' %} <span class="sr-only">(current)</span>{% endif %}</a>
            </li>
            <li class="nav-item{% if url == 'lablog_list' %} active {% endif %}">
                <a class="nav-link" href="{% url 'lablog_list' %}">值班日志{% if url == 'lablog_list' %} <span class="sr-only">(current)</span>{% endif %}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">子台日志</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">子台标定</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">子台维护</a>
            </li>

            <!--li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="https://example.com" id="dropdown01" data-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false">Dropdown</a>
                <div class="dropdown-menu" aria-labelledby="dropdown01">
                    <a class="dropdown-item" href="#">Action</a>
                    <a class="dropdown-item" href="#">Another action</a>
                    <a class="dropdown-item" href="#">Something else here</a>
                </div>
            </li-->
        </ul>
        {% if user.is_authenticated %}
            <ul class="navbar-nav">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                       data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {{ user.username }}
                    </a>
                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
                        <a class="dropdown-item" href="{% url 'password_change' %}">修改密码</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="{% url 'logout' %}">注销</a>
                    </div>
                </li>
            </ul>
        {% else %}
            <div class="form-inline my-2 my-lg-0">
                <a href="{% url 'login' %}" class="btn btn-outline-light">登录</a>
                {#                <a href="{% url 'signup' %}" class="btn btn-primary ml-2">Sign up</a>#}
            </div>
        {% endif %}
        <!--form class="form-inline my-2 my-lg-0">
            <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
        </form-->
    </div>
</nav>